package common.utils
{
	public class StringManager
	{		
		
		public static function Trim(st:String):String{
			return st.replace(" +$", "");
		}
		
		public static function GetSafeWSString(st:String):String{
			var st2:String = Trim(st);
			if (st2 == "")
				return null;
			else
				return st2;
		}
		
		public static function Padding(st:String, ch:String, len:int, bLeft:Boolean):String{
			if (bLeft){
				while (st.length < len){
					st = ch + st;
				}
			}
			else{
				while (st.length < len){
					st = st + ch;
				}
			}
			return st;
		}
		
		public static function IsErrorMsg(st:String):Boolean{
			if (st.substr(0, 2) == "错误")
				return true;
			else
				return false;
		}
	}
}